// #include "HCSR04.h"


// volatile uint32_t TimeCount = 0;

// void HCSR04_Init(void) {
//   DL_GPIO_clearPins(HCSR04_PORT, HCSR04_RX_PIN);
// }

// float HCSR04_getValue() {
//   float Distance, Distance_mm;
//   uint32_t Time_end;

//   DL_GPIO_setPins(HCSR04_PORT, HCSR04_TX_PIN);
//   delay_us(50);
//   DL_GPIO_clearPins(HCSR04_PORT, HCSR04_TX_PIN);

//   while (!(DL_GPIO_readPins(HCSR04_PORT, HCSR04_RX_PIN)));
//   TimeCount = 0;
//   while (DL_GPIO_readPins(HCSR04_PORT, HCSR04_RX_PIN));
//   Time_end = TimeCount * 50;

//   if (Time_end < 24000) {
//     Distance = Time_end * 0.000001f * 340 / 2;
//     Distance_mm = Distance * 1000;
//   }

//   return Distance_mm;
// }
